import com.zeng.dao.UserDao;
import com.zeng.pojo.Hello;
import com.zeng.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author zeng
 * @data 2021/06/06 11:30
 */
public class Mytest {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
        Hello hello = (Hello) context.getBean("HELLO");
        System.out.println(hello);
    }

    @Test
    public void Userlmpl(){
        ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
        UserDao mysql = context.getBean("Mysql", UserDao.class);
        mysql.getUser();
    }
    @Test
    public void UserService(){
        ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
        UserService UserService = context.getBean("UserService", UserService.class);
        UserService.getUser();
    }

}

